<template>
    <div>
      <div class="header">
        <div class='cover'></div>
        <div class="nav">
          <ul class='li-context'>
            <li v-for="item in this.datas" class="nav-li"  @click="getType(item)">
                <router-link to="/MainMenu" :menuData="menuData">{{item.type}}</router-link>
            </li>
          </ul>
        </div>
      </div>
      <div class="menu">
        <router-view></router-view>
        <div class="home-img">
          <img src="../Material/home.jpg" v-show="flag">
        </div>
      </div>
    </div>
</template>

<script>
  import myHeader from "./Header/Header.vue"
  import MainMenu from "./MainMenu/MainMenu.vue"
  import {mapGetters,mapActions}from "vuex"

  export default {
        props:{
          datas:{}
        },
        data() {
            return {
              menuData:{},
              flag:true
            }
        },
        components:{
          MainMenu,
        },
        methods:{
          ...mapActions(['showType']),
          getType(item){
            this.menuData=item
            this.flag=false
            this.showType({item})
          }
        },
        computed:{
          ...mapGetters(["getShow"])
        }
    }
</script>

<style lang="less" scoped>

  .header{
    position: fixed;
    width: 100%;
    z-index: 10;
    font-size: 0;
  }
.menu{
  flex: 1;
  width: 100%;
  position: absolute;
  top: 136px;
  margin-bottom:80px ;
  overflow: hidden;
  font-size: 0px;
  .home-img{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #a14b3c;
    bottom: 0px;
    img{
      margin-top: 250px;
      padding: 80px;
    }
  }
}

.nav{
  display: flex;
  background-color: #c55d4c;
  padding-top: 10px;
  height: 56px;
  a{
    text-decoration: none;
    color: white;
  }
  .cover{
    width: 100%;
    height: 66px;
  }
  .li-context{
    overflow: hidden;
    margin-left: 40px;
    margin-right: 40px;
    .nav-li{
      float: left;
      list-style: none;
      padding: 14px;
      vertical-align: middle;
      letter-spacing: 15px;
      font-size: 18px;
      font-weight: 800;
      margin-left: 1px;
      border: 1px solid #000;
      border-radius: 3px;
      color: white;
    }
    .nav-li:active{
      background-color: #7d3a31;
    }
  }

}

</style>
